function SDOreportTimebombAS () {
    var fonts = document.getElementsByTagName ("font");
    for (var i=0; i<fonts.length; i++) {
        var fnt = fonts[i];
        var txt = fnt.textContent;
        if (txt.indexOf ("Tbomb active in") != -1) {
            var coords = fnt.lastChild.textContent;
            var split = coords.split ("[");
            var sector = split[0];
            coords = "[" + split[1];
            SDOsubmitManualAlert (sector.substr(0, sector.length-1), coords, fnt.firstChild.textContent + " " + fnt.lastChild.textContent);
            break;
        }
    }
}

function SDOsubmitManualAlert (sector, coords, info) {
    var url = POgetServerUrl("alerter/save_manual_alert.php", false);
    var query = "atype=5"
        + "&asector="+sector
        + "&acoords="+coords
        + "&aheader="+info
        + "&adetails=none"
        + "&universe="+POgetUniverse ()
        + "&userid="+POgetUserID ()
        + "&uname="+POgetUserName ()
        + "&vcode="+POgetValidationCode ();
    POajaxPost (url, "POST", query, null)
}

// To ensure that the po_utils.js is already loaded
window.onload = setTimeout(function(){
   SDOreportTimebombAS();
}, 100);

